class AttachmentCommonModel {
  int? action;
  List<AttachmentFields>? fields;
  int? linkType;
  String? txt1;
  String? linkUrl;
  String? title;
  String? date;
  String? txt2;

  AttachmentCommonModel(
      {this.action,
      this.fields,
      this.linkType,
      this.txt1,
      this.linkUrl,
      this.title,
      this.date,
      this.txt2});

  AttachmentCommonModel.fromJson(Map<String, dynamic> json) {
    action = json['action'];
    if (json['fields'] != null) {
      fields = <AttachmentFields>[];
      json['fields'].forEach((v) {
        fields!.add(AttachmentFields.fromJson(v));
      });
    }
    linkType = json['link_type'];
    txt1 = json['txt1'];
    linkUrl = json['link_url'];
    title = json['title'];
    date = json['date'];
    txt2 = json['txt2'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['action'] = action;
    if (fields != null) {
      data['fields'] = fields!.map((v) => v.toJson()).toList();
    }
    data['link_type'] = linkType;
    data['txt1'] = txt1;
    data['link_url'] = linkUrl;
    data['title'] = title;
    data['date'] = date;
    data['txt2'] = txt2;
    return data;
  }
}

class AttachmentFields {
  String? n;
  String? v;

  AttachmentFields({this.n, this.v});

  AttachmentFields.fromJson(Map<String, dynamic> json) {
    n = json['n'];
    v = json['v'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['n'] = n;
    data['v'] = v;
    return data;
  }
}
